#include <cstdio>
using namespace std;
int main(void){
    int t;
    while(~scanf("%d",&t)){
        if(0==t){
            break;
        }
        while(t--){
            double x1,y1,x2,y2,x3,y3;
            scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
            printf("%.1lf %.1lf\n",(x1+x2+x3)/3,(y1+y2+y3)/3);
        }
    }
    return 0;
}